:root {
  /* 主要颜色 */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --info-color: #0891b2;
  
  /* 中性色 */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* 边框半径 */
  --border-radius-sm: 0.375rem;
  --border-radius: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* 渐变背景 */
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
  --gradient-secondary: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
}

/* 全局重置 */
* {
  box-sizing: border-box;
}

body, html {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.container {
  flex: 1 0 auto;
  padding-bottom: 2rem;
}

footer {
  flex-shrink: 0;
}

/* 导航栏样式 */
.navbar-modern {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 0;
}

.navbar-modern .navbar-brand {
  color: var(--gray-800) !important;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-modern .navbar-brand i {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.navbar-modern .nav-link {
  color: var(--gray-600) !important;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  margin: 0 0.25rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--border-radius);
}

.navbar-modern .nav-link:hover {
  color: var(--primary-color) !important;
  background-color: var(--gray-100);
}

.navbar-modern .nav-link.active {
  color: var(--primary-color) !important;
  background-color: rgba(37, 99, 235, 0.1);
}

/* 卡片样式 */
.card-modern {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.card-modern .card-header {
  background: var(--gradient-primary);
  border-bottom: none;
  padding: 2rem 1.5rem;
  text-align: center;
}

.card-modern .card-header h3,
.card-modern .card-header h4 {
  color: white;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.card-modern .card-header p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
}

.card-modern .card-body {
  padding: 2rem;
}

/* 按钮样式 */
.btn-modern {
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-lg);
  border: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-modern:hover::before {
  left: 100%;
}

.btn-primary.btn-modern {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary.btn-modern:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-success.btn-modern {
  background: var(--success-color);
  color: white;
}

.btn-success.btn-modern:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-secondary.btn-modern {
  border: 2px solid var(--gray-300);
  color: var(--gray-700);
  background: white;
}

.btn-outline-secondary.btn-modern:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--gray-800);
}

/* 表单样式 */
.form-control-modern {
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: white;
}

.form-control-modern:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.input-group-modern .input-group-text {
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-right: none;
  color: var(--gray-600);
}

.input-group-modern .form-control-modern {
  border-left: none;
}

.input-group-modern .form-control-modern:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group-modern:focus-within .input-group-text {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary-color);
}

/* 警告框样式 */
.alert-modern {
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.alert-danger.alert-modern {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

.alert-info.alert-modern {
  background: rgba(8, 145, 178, 0.1);
  color: var(--info-color);
  border-left: 4px solid var(--info-color);
}

.alert-warning.alert-modern {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning-color);
  border-left: 4px solid var(--warning-color);
}

/* 特色卡片 */
.feature-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-xl);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.feature-card .icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.5rem;
  color: white;
}

.feature-card .icon.icon-primary {
  background: var(--gradient-primary);
}

.feature-card .icon.icon-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #10b981 100%);
}

.feature-card .icon.icon-info {
  background: linear-gradient(135deg, var(--info-color) 0%, #06b6d4 100%);
}

.feature-card .icon.icon-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #f59e0b 100%);
}

.feature-card .icon.icon-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #ef4444 100%);
}

.feature-card .icon.icon-secondary {
  background: var(--gradient-secondary);
}

.feature-card h5 {
  color: var(--gray-800);
  font-weight: 600;
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--gray-600);
  margin-bottom: 0;
  line-height: 1.6;
}

/* 页脚样式 */
.footer-modern {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-modern .text-muted {
  color: var(--gray-500) !important;
}

.footer-modern a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-modern a:hover {
  color: var(--primary-hover);
}

/* 错误页面样式 */
.error-icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  background: rgba(220, 38, 38, 0.1) !important;
  color: var(--danger-color) !important;
  font-size: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .card-modern .card-body {
    padding: 1.5rem;
  }
  
  .feature-card {
    padding: 1.5rem;
  }
  
  .card-modern .card-header {
    padding: 1.5rem 1rem;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* 加载动画 */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}
